<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>쪽지보내기</title>
<style type="text/css">
body{
	background-color: #666666;
	font-size: 12px;
	font-family: 100%/1.4 나눔고딕;
	color:#FFFFFF;
	margin: 10px;
	padding: 5px;
}
</style>
<script src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function(){
	$("#replyBtn").click(function(){
		var url = $(this).parent().attr("href");
		location.href = url;
	});
	$("#closeBtn").click(function(){
		window.close();
	});
});
</script>
</head>
<body>
<c:set var="msg" value="${requestScope.msg }"></c:set>
<table>
<tr>
	<c:choose>
		<c:when test="${msg.to.nickname==null }">
			<td>from. </td>
			<td><b>${msg.from.nickname }</b></td>
		</c:when>
		<c:otherwise>
			<td>to. </td>
			<td><b>${msg.to.nickname }</b></td>
		</c:otherwise>
	</c:choose>
	
</tr>
<tr>
	<td>제목</td>
	<td>${msg.title }</td>
</tr>
<tr>
	<td>내용</td>
	<td style="border:1px solid; border-color: #F3F3F3; width: 150px;"><pre>${msg.contents }</pre></td>
</tr>
<tr align="right">
	<td colspan="2">
		<c:if test="${msg.from.uId!=sessionScope.mvo.uId&&msg.from.uId!=0 }">
			<a href="sns/msgwrite.jsp?uid=${msg.from.uId }&nick=${msg.from.nickname }">
				<input type="button" id="replyBtn" value="답장하기"></a>
		</c:if>
		<input type="button" id="closeBtn" value="닫기">
	</td>
</tr>
</table>

</body>
</html>